package spring.core.examples.java.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.Profile;

import spring.core.examples.xml.Person;

/**
 * Demonstrates how to configure Spring context using Java classes. Note that
 * all beans configured in this configuration are singleton!
 */
@Configuration
@ImportResource("classpath:/my-properties.xml")
@Profile("test")
public class PersonTestConfiguration {
	/**
	 * Elke.
	 * 
	 * @return the person
	 */
	@Bean
	public Person elke() {
		Person myResult = new Person();
		myResult.setFirstName("Elke");
		myResult.setName("Elegant");
		myResult.setAge(99);
		return myResult;
	}
}
